<script setup lang="ts">
import { ref } from 'vue'
import ClassManage from './components/education/classManage.vue'
import ScoreManage from './components/education/scoreManage.vue'
import { TClass } from '@/Types/education'

/**
 * 模块名: 教务管理
 * 代码描述:统一管理班级和成绩
 * 作者:mck
 * 创建时间:2025/02/14 20:25:20
 */
// 初始化
const classManageSetting = ref({
	data: {} as TClass,
	visible: true
})
const scoreManageSetting = ref({
	data: {} as TClass,
	visible: false
})

// 处理班级选择
const handleClassSelect = (classInfo: any) => {
	// console.log(classInfo)

	// 接收班级信息
	scoreManageSetting.value.data = classInfo
	classManageSetting.value.visible = false
}
</script>

<template>
	<div class="education-manage">
		<!-- 班级管理模块 -->
		<ClassManage v-show="classManageSetting.visible" @set-class-info="handleClassSelect" />

		<!-- 成绩管理模块 -->
		<ScoreManage
			v-show="!classManageSetting.visible"
			:score-manage-setting="scoreManageSetting"
			@back="classManageSetting.visible = true"
		/>

		<!-- 科目管理模块 -->
		<!-- <SubjectManage />	 -->
	</div>
</template>

<style scoped lang="scss">
.education-manage {
	padding: 20px;
	height: 100%;
	box-sizing: border-box;
	background-color: var(--el-bg-color);
}
</style>
